package liquidfs.data;

import com.thoughtworks.xstream.annotations.*;
import com.thoughtworks.xstream.converters.extended.*;

import liquidfs.data.ex.*;
import liquidfs.data.ops.*;

@XStreamAlias("exception-result")
public class ExceptionResult<T> extends Result<T> {

   @XStreamConverter(ToStringConverter.class)
   private FileSystemException exception;
   
   public ExceptionResult(Operation<T> operation, FileSystemException data) {
      super(operation, null);
      this.exception = data;
   }
   
   @Override
   public T getData () throws FileSystemException {
      throw this.exception;
   }
}
